package com.lyb.spzx.common.utils;

import com.lyb.spzx.model.dto.system.system.SysUser;

public class AuthContextUtil {
    //创建一个ThreadLocal 对象
    private static final ThreadLocal<SysUser> threadlocal = new ThreadLocal<>();
    //定义存储数据的静态方法
    public static void set(SysUser sysUser){
        threadlocal.set(sysUser);
    }
    //定义获取数据的方法
    public static SysUser get(){
        return threadlocal.get();
    }

    //删除数据的方法
    public static void delete(){
        threadlocal.remove();
    }
}
